public class CSSParser extends Object
Modifier and Type | Field and Description |
---|---|
private File |
_file
Input file.
|
private FileReader |
_fr
Input file.
|
private ICSSParserHandler |
_handler
Handler which receives events from the parser.
|
private BufferedReader |
_reader
Input file.
|
Constructor and Description |
---|
CSSParser() |
Modifier and Type | Method and Description |
---|---|
private void |
destroy()
Closes the file specified in the
parse() method. |
private void |
doParsing()
Parses the CSS file.
|
private void |
init()
Opens the file specified in the
parse() method. |
void |
parse(File f,
ICSSParserHandler handler)
Parser the CSS file and sends events to the handler.
|
private void |
parseStyle(String style)
Parses single CSS style.
|
private File _file
private FileReader _fr
private BufferedReader _reader
private ICSSParserHandler _handler
public void parse(File f, ICSSParserHandler handler)
f
- CSS filehandler
- handler receiving eventsprivate void init() throws ErrorException
parse()
method.ErrorException
- when the file can't be openedprivate void destroy() throws ErrorException
parse()
method.ErrorException
- when the file can't be closedprivate void doParsing() throws IOException
".bold { font-weight:bold; }
)
parseStyle()
method is called.IOException
- input error occursprivate void parseStyle(String style)
style
- style definition (including style name and curly brackets)